<?php /* Smarty version 2.6.18, created on 2015-09-10 14:54:34
         compiled from addAccountChannel.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "top.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
	<li><i class="icon-home home-icon"></i> <a
		href="index.php">首页</a></li>
</ul>
					</div>

				<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								
								<div class="row">
									<div class="col-sm-12">
										<div class="widget-box">
											<div class="widget-header header-color-blue2">
												<h4 class="lighter smaller"></h4>
											</div>

											<div class="widget-body">
												<div class="widget-main padding-8">
												
													<form class="form-horizontal" role="form">
														<br/>
											
														<div class="form-group">
															<label class="col-sm-4 control-label no-padding-right" for="form-field-5">id:</label>
															<div class="col-sm-6">
																<input type="text" id="id" class="col-xs-3 col-sm-5">
															</div>
														</div>
														<div class="form-group">
															<label class="col-sm-4 control-label no-padding-right" for="form-field-5">prefix:</label>

															<div class="col-sm-6">
																<input type="text" id="prefix" class="col-xs-3 col-sm-5">
															</div>
														</div>
														
													 <div class="form-group">
															<label class="col-sm-4 control-label no-padding-right" for="form-field-5">name:</label>

															<div class="col-sm-6">
																<input type="text" id="name" class="col-xs-3 col-sm-5">
															</div>
														</div>
														
														 <div class="form-group">
															<label class="col-sm-4 control-label no-padding-right" for="form-field-5">note:</label>

															<div class="col-sm-6">
																<input type="text" id="note" class="col-xs-3 col-sm-5">
															</div>
														</div>
														
														 <div class="form-group">
															<label class="col-sm-4 control-label no-padding-right" for="form-field-5">app_keys:</label>

															<div class="col-sm-6">
																<input type="text" id="app_keys" class="col-xs-3 col-sm-5">
															</div>
														</div>
														
												
													</form>
													
													<h3 class="header smaller lighter green"></h3>
													<div class="clearfix">
														<label class="col-sm-5 control-label no-padding-right" for="form-field-5"></label>
															<button type="button" onclick = "addChannel();" class="btn btn-info btn-success">
																<!--<i class="icon-bolt"></i>-->
																添加
															</button>
													
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->
				</div><!-- /.main-content -->
				
<script type="text/javascript">

function addChannel() {
	var param = {};
	param['mod'] 		= 'Account';
	param['do']  		= 'addChannel';
	
	param['id']		 	= jQuery('#id').val();
	param['prefix'] 	= jQuery('#prefix').val();
	param['name'] 		= jQuery('#name').val();
	param['note'] 		= jQuery('#note').val();
	param['app_keys'] 	= jQuery('#app_keys').val();
			
	if (!param['id']) {
		alert('请输入id');
	}  else if(!param['prefix']) {
		alert('请输入前缀prefix');
	} else if(!param['name']) {
		alert('请输入渠道名称');
	}  else if(!param['note']) {
		alert('请输入note');
	} else if(!param['app_keys']) {
		alert('请输入app_keys');
	} else {
		$.ajax({
			type:'POST',
			url:'index.php',
			data:param,
			dataType:'html',
			success:function(data) {
				var dataObj = eval("(" + data + ")");//转换为json对象
				if (dataObj.code != 0) {
					alert(dataObj.msg);
				} else {
					alert(dataObj.msg);
					window.location.href ="index.php?mod=Account&do=listChannel&action=0";
				}
			}
		});
	}
}
</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>